package com.cellulam.framework.scheduled;


import com.cellulam.framework.core.enums.CodeDescriptionFeature;
import com.cellulam.framework.core.utils.EnumHelper;
import lombok.Getter;

/**
 * 处理状态
 */
@Getter
public enum TaskStatus implements CodeDescriptionFeature {

    /**
     * 初始
     */
    INITIALIZED(1, "初始"),
    /**
     * 处理中
     */
    PROCESSING(2, "处理中"),
    /**
     * 推迟处理
     */
    DELAY(3, "推迟处理"),
    /**
     * 完成
     */
    FINISHED(99, "完成");

    private final int code;
    private final String description;

    TaskStatus(int code, String description){
        this.code = code;
        this.description = description;
    }

    public static TaskStatus valueOf(int code){
        return EnumHelper.valueOf(code, TaskStatus.class);
    }
}
